home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 90 / CD Actual 90.iso / Software3D / K-3D / k3d-0.4.2.1 / share / lsystem / menger-cube.ls < prev    next >
Encoding:
Text File  |  2004-07-23  |  737 b   |  25 lines

  1. # --- L-System Parser/Mutator --- Lj Lapre ----------------------------------
  2. #
  3. # This ls produces menger cubes. Recursion level 0 will produce a
  4. # 0th order cube, 2 a 1th, 4 a 3th, and 6 a 4th. Level 8 will
  5. # produce a 5th order menger with a total off 960.000 polygons !
  6. #
  7. # Change F= ... to F=[~(5)"(.333333)[-f+&f^B]]f add randomness.
  8. #
  9. # One can replace B= ... with a number of alternatives:
  10. #
  11. # B=[fz+zF]^f&[FFF|z|+zFF|z|+zFF|z|+zF]^f&[fz+zF]
  12. # B=[fz+zF]^f&[FFF|z|+zFF|z|+zFF|z|+zF|z|+zF]^f&[fz+zF]
  13. # B=[FFF|z|+zFF|z|+zFF|z|+zF]^f&[FfF|z|+zfF|z|+zfF]^f&[FFF|z|+zFF|z|+zFF|z|+zF]
  14. #
  15. 4
  16. 90
  17. 142.857
  18. #
  19. F
  20. #
  21. F=["(.333333)[-f+&f^B]]f
  22. #
  23. B=[FFF|z|+zFF|z|+zFF|z|+zF]^f&[FfF|z|+zfF|z|+zfF]^f&[FFF|z|+zFF|z|+zFF|z|+zF]
  24. @
  25.